﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SerialBrowserBridge.Devices
{
    public interface IBlockDevice
    {
        /// <summary>
        /// Send data to device
        /// </summary>
        /// <param name="data"></param>
        void WriteBlock(String data);

        /// <summary>
        /// Recieve data from device
        /// </summary>
        event Action<String> ReadBlock;

        /// <summary>
        /// Initialize device
        /// </summary>
        /// <returns>true=success, false=fail</returns>
        bool Initialize();

        /// <summary>
        /// Triggered on error (message, isFatal)
        /// </summary>
        event Action<String, Boolean> Error;
    }
}
